﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IPC.Communication.Core.IMessage
{
    public class AlienMessage : INetMessage
    {
        public int ProtocolHeadBytesLength
        {
            get
            {
                return 5;
            }
        }

        public byte[] HeadBytes
        {
            get;
            set;
        }

        public byte[] ContentBytes
        {
            get;
            set;
        }

        public byte[] SendBytes
        {
            get;
            set;
        }

        public bool CheckHeadBytesLegal(byte[] token)
        {
            bool flag = this.HeadBytes == null;
            bool result;
            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = this.HeadBytes[0] == 72 && this.HeadBytes[1] == 115 && this.HeadBytes[2] == 110;
                result = flag2;
            }
            return result;
        }

        public int GetContentLengthByHeadBytes()
        {
            return (int)this.HeadBytes[4];
        }

        public int GetHeadBytesIdentity()
        {
            return 0;
        }
    }
}
